home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
minix
/
up1510b.tgz
/
up1510b
/
src
/
test
/
test7.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-07-23
|
642b
|
52 lines
/* test 7 */
#include <signal.h>
#define MAX_ERROR 4
extern int errno;
int subtest;
int errct;
int zilch[5000];
main()
{
int i;
printf("Test 7 ");
for (i = 0; i < 150; i++) {
test70();
}
if (errct == 0)
printf("ok\n");
else
printf("%d errors\n", errct);
}
test70()
{
int i, err, pid;
signal(SIGQUIT, SIG_IGN);
err = 0;
for (i = 0; i < 5000; i++)
if (zilch[i] != 0) err++;
if (err > 0) e(1);
kill(getpid(), SIGQUIT);
}
e(n)
int n;
{
printf("Subtest %d, error %d errno=%d ", subtest, n, errno);
perror("");
if (errct++ > MAX_ERROR) {
printf("Too many errors; test aborted\n");
exit(1);
}
}